package com.ler.springcloud.clientdemo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lww
 * @date 2019-08-18 17:41
 * <p>
 * 向Server注册一个服务
 */
@RestController
@RequestMapping("/")
public class HelloController {

	@Value("${server.port}")
	String port;

	@GetMapping("/hi")
	public String home(@RequestParam String name) {
		System.out.println("name = " + name);
		return "hi " + name + ",i am from port:" + port;
	}
}
